package com.group.config;

import org.springframework.context.annotation.Configuration;

/**
 * @author lins
 * @date 2021/11/16 14:28
 */
@Configuration
public class GatewaySentinelConfig {
    public GatewaySentinelConfig(){
//        GatewayCallbackManager.setBlockHandler(new BlockRequestHandler() {
//            @Override
//            public Mono<ServerResponse> handleRequest(ServerWebExchange serverWebExchange, Throwable throwable) {
//                R r = R.error(BizCodeEnum.SENTINEL_EXCEPTION.getCode(), BizCodeEnum.SENTINEL_EXCEPTION.getMessage());
//                String json = JSON.toJSONString(r);
//                return ServerResponse.ok().body(Mono.just(json),String.class);
//            }
//        });
    }
}
